<%-- 
    Document   : cookieDemo
    Created on : 2019-9-5, 8:29:18
    Author     : danny
--%>
<%@page import="javax.servlet.http.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
Cookie cookie = new Cookie("key", "value");
response.addCookie(cookie);
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>
